<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@include file="/WEB-INF/pages/common/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <%@include file="/WEB-INF/pages/common/head.jsp"%>
    <%@include file="/resources/datepicker/datepicker.jsp"%>
    <script type="text/javascript">
        function search_() {
            document.forms[0].submit();
        }
        var operateDialog;
        function dialogSupplier_(){
            var href = '${path}/basedata/supplier/dialogUI.do';
            operateDialog = $("#operateDialog").dialog({
                title : '<spring:message code='msg.dialog.choose'/>',
                width : 650,
                height : 400
            });
            $("#operateIFrame")[0].src=href;
            operateDialog.dialog('open');
        }
        function dialogSupplierReturn(row){
            $("#supplierId").val(row['id']);
            $("#supplierCode").val(row['code']);
            $("#supplierName").val(row['name']);
            operateDialog.dialog('close');
        }
    </script>
</head>
<body class="easyui-layout">
<form action="${path}/business/ipic_system/supplier_ipic_summary/listUI.do">
    <div data-options="region:'north'" style="overflow: hidden;height: 55px;">
        <div class="datagrid-toolbar" style="height: auto">
            <fieldset>
                <legend><spring:message code="label.condition"/></legend>
                <table id="tableForm" width="100%">
                    <tr>
                        <td align="right"><spring:message code="label.year"/>：</td>
                        <td>
                            <input type="text" name="year" value="${entity.year}"
                                   onFocus="WdatePicker({isShowClear:false,isShowToday:false,dateFmt:'yyyy',readOnly:true})" class="Wdate"/>
                        </td>
                        <td align="right"><spring:message code="label.supplier.code"/>：</td>
                        <td>
                            <input type="hidden" id='supplierId' name="supplierId" value="${entity.supplierId}"/>
                            <input type="text" id="supplierCode" onclick="dialogSupplier_();" readonly="true" value="${entity.supplierCode}"/>
                        </td>
                        <td align="right"><spring:message code='label.supplier.name'/>:</td>
                        <td align="left">
                            <input type="text" id="supplierName" style="width: 180px;" disabled value="${entity.supplierName}"/>
                        </td>
                        <td align="right">
                            <a class="easyui-linkbutton" href="javascript:void(0);" iconCls="icon-search" onclick="search_();"><spring:message code="bar.command.search"/></a>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </div>
    </div>
<div data-options="region:'center'">
    <c:choose>
        <c:when test="${imagePath!=null && imagePath!=\'\'}">
            <table class="mytable" width="100%;">
                <tr><td colspan="2"></td></tr>
                <tr>
                    <td>
                        <table>
                            <thead>
                            <tr>
                                <th style="text-align: center" rowspan="2"><spring:message code="table.head.month"/></th>
                                <th style="text-align: center" colspan="3"><spring:message code="table.head.ipic.summary.ipic.value"/></th>
                                <th style="text-align: center" colspan="2"><spring:message code="table.head.ipic.summary.ppm.value"/></th>
                            </tr>
                            <tr>
                                <th style="text-align: center"><spring:message code="table.head.ipic.summary.ipic.value.month"/></th>
                                <th style="text-align: center"><spring:message code="table.head.ipic.summary.ipic.value.year.average"/></th>
                                <th style="text-align: center"><spring:message code="table.head.ipic.summary.ipic.value.rolling"/></th>

                                <th style="text-align: center"><spring:message code="table.head.ipic.summary.ppm.value.month"/></th>
                                <th style="text-align: center"><spring:message code="table.head.ipic.summary.ppm.value.year.accumulate"/></th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${entityList}" var="entity">
                                <tr>
                                    <td style="text-align: center">${entity.month}</td>

                                    <td style="text-align: center">${entity.ipicMonth}</td>
                                    <td style="text-align: center">${entity.ipicAverageYear}</td>
                                    <td style="text-align: center">${entity.ipicRolling}</td>

                                    <td style="text-align: center">${entity.ppmMonth}</td>
                                    <td style="text-align: center">${entity.ppmAccumulateYear}</td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </td>
                    <td style="vertical-align: top;" rowspan="3">
                        <table>
                            <thead>
                            <tr>
                                <th style="text-align: center"><spring:message code="table.head.claim.start.date"/></th>
                                <th style="text-align: center"><spring:message code="table.head.claim.code"/></th>
                                <th style="text-align: center"><spring:message code="table.head.claim.problem.desc"/></th>
                                <th style="text-align: center"><spring:message code="table.head.claim.claim.status"/></th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${claimVoList}" var="entity">
                                <tr>
                                    <td style="text-align: center">${entity.startDateStr}</td>
                                    <td style="text-align: center">${entity.code}</td>
                                    <td style="text-align: center">${entity.problemDesc}</td>
                                    <td style="text-align: center">${entity.claimStatus}</td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                            ${lastYear} AverageIPICValue：<input type="text" value="${lastYearIPICAverage}" style="width: 40px;" disabled/>
                        &nbsp;
                        AverageIPICTarget：<input type="text" value="${IPICTarget}" style="width: 40px;" disabled/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div>
                            <img src="${path}${imagePath}" width="600" height="400" title="图表">
                        </div>
                    </td>
                </tr>
            </table>
        </c:when>
        <c:otherwise>
            <div style="font-size: 30px;font-weight:bolder;color: red">
                <spring:message code='msg.please.choose.supplier'/>
            </div>
        </c:otherwise>
    </c:choose>
</div>
</form>
<div id="operateDialog" class="easyui-dialog"
     data-options="iconCls:'icon-save',resizable:true,modal:true,closed: true,collapsible:true,maximizable:true">
    <iframe scrolling="auto" id='operateIFrame' frameborder="0"  src="" style="width:100%;height:100%;"/>
</div>
</body>
</html>